package org.millioncall.yueyoga.admin.dao;

import java.util.List;
import java.util.Map;

import org.millioncall.openplatform.common.PaginatedList;
import org.millioncall.yueyoga.admin.model.Group;

/**
 * @author lisj
 * @date Mar 14, 2014 3:19:15 PM
 */
public interface GroupDAO {
	/**
	 * 根据用户编号查询该用户所有的用户组
	 * 
	 * @param userId
	 * @return
	 */
	public List<Group> findByUserId(String userId);

	public void save(Group instance);

	public void delete(Group instance);

	public Group findById(int id);

	public List<Group> findByProperty(String propertyName, Object value);

	public List<Group> findByName(String name);

	public List<Group> findByEnabled(Boolean enabled);

	public List<Group> findAllGroups();

	public List<Group> findAllGroup();

	public List<Group> findGroupsByNames(List<String> names, boolean needEnabled);

	public PaginatedList<Group> findGroupsInPage(int start, int limit,
			Map<String, Object> map);

	public int saveGroup(Map<String, Object> map);

	public int saveGroupRole(Map<String, Object> map);

	public int savegrantRoles(Map<String, Object> map);
	
	public int savegrantHall(Map<String, Object> map);

	public int saveGrantGroups(Map<String, Object> map);

	public int updateGroup(Map<String, Object> map);

	public int updateGroupRole(Map<String, Object> map);

	public Group findGroupById(int id);

	public Group findGroupByName(String name);
	
	public Group findGroupByChName(String name);

	public void deleteGroupById(int[] id);

	public void deleteGroupRoleById(int[] id);

	public void deleteGroupUserById(int[] id);

	public int deleteGroupUserByUserId(String userId);
	
	public int deleteRoleById(String groupId);
	
	public int deleteHallById(String groupId);

}